﻿<UserControl x:Class="centraldba.msx_config_addin.msx_list"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
             xmlns:msx="clr-namespace:centraldba_library.Admin;assembly=centraldba_library"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MSXConfigurator"
             Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}">
    <Grid>
        <TreeView Name="tvMSXServers" ItemsSource="{Binding}" SelectedItemChanged="tvMSXServers_SelectedItemChanged">
            <TreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type msx:msx_server}" ItemsSource="{Binding msx_groups}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Resources\server.png" />
                        <TextBlock Text="{Binding server_name}" />
                    </StackPanel>
                </HierarchicalDataTemplate>
                <HierarchicalDataTemplate DataType="{x:Type msx:target_group}" ItemsSource="{Binding member_servers}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Resources\folder_closed.png" />
                        <TextBlock Text="{Binding group_name}" />
                    </StackPanel>
                </HierarchicalDataTemplate>
                <DataTemplate DataType="{x:Type msx:target_server}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Resources\database.png" />
                        <TextBlock Text="{Binding server_name}" />
                    </StackPanel>
                </DataTemplate>
            </TreeView.Resources>
        </TreeView>
    </Grid>
</UserControl>
